package com.github.lfg.study.java.jvm.app.jmx;

import org.springframework.jmx.export.annotation.*;
import org.springframework.stereotype.Service;

/**
 * @author lfg
 * @version 1.0
 */
@Service
@ManagedResource(description = "spring jmx注解的demo类")
public class ManagedDemo {

    @ManagedOperation(description = "执行方法示例 execReturnString")
    @ManagedOperationParameters(value = {
            @ManagedOperationParameter(name = "paramOne", description = "this is paramOne desc"),
            @ManagedOperationParameter(name = "paramTwo", description = "this is paramTwo desc")
    })
    public String execReturnString(String paramOne, String paramTwo) {
        return paramOne + "-" + paramTwo;
    }

    @ManagedOperation(description = "执行方法示例 execVoid")
    public void execVoid() {

    }

    @ManagedAttribute(description = "ManagedAttribute 使用示例")
    public String getProperties() {
        return "this is ManagedAttribute";
    }

    @ManagedAttribute(description = "ManagedAttribute 使用示例")
    public String xxx() {
        return "this is xxx";
    }



}
